import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AgentLatitudeVO, AgentLatitudeForm, AgentLatitudeQuery } from '@/api/commission/agentLatitude/types';

/**
 * 查询代理商维度列表
 * @param query
 * @returns {*}
 */

export const listAgentLatitude = (query?: AgentLatitudeQuery): AxiosPromise<AgentLatitudeVO[]> => {
  return request({
    url: '/commission/agentLatitude/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询代理商维度详细
 * @param id
 */
export const getAgentLatitude = (id: string | number): AxiosPromise<AgentLatitudeVO> => {
  return request({
    url: '/commission/agentLatitude/' + id,
    method: 'get'
  });
};

/**
 * 新增代理商维度
 * @param data
 */
export const addAgentLatitude = (data: AgentLatitudeForm) => {
  return request({
    url: '/commission/agentLatitude',
    method: 'post',
    data: data
  });
};

/**
 * 修改代理商维度
 * @param data
 */
export const updateAgentLatitude = (data: AgentLatitudeForm) => {
  return request({
    url: '/commission/agentLatitude',
    method: 'put',
    data: data
  });
};

/**
 * 删除代理商维度
 * @param id
 */
export const delAgentLatitude = (id: string | number | Array<string | number>) => {
  return request({
    url: '/commission/agentLatitude/' + id,
    method: 'delete'
  });
};
